import React from "react";
import {Menu, Layout} from "antd";
import './TopHead_style.scss';
import {first_menus} from '../../../config/menus';
import {NavLink} from "react-router-dom";
const {Header}=Layout;
const {Item}=Menu;
export default (props)=>{
	let pathname=props.pathname.split('/').filter(item=>item);
	return (
		<Header className="header">
			<div className="logo">baidu_map</div>
			<Menu theme="dark" mode="horizontal" defaultSelectedKeys={[`/work`]} selectedKeys={`/${pathname[0]}`}>
				{first_menus.map(list=><Item key={list.name}><NavLink to={list.to}>{list.title}</NavLink></Item>)}
			</Menu>
		</Header>
	)
}
